package com.yanle.pattern.singleton;

/**
 * @Description: 懒汉模式（线程安全）
 * @Author Richard
 * @Date 2018/4/11 14:27
 */
public class SynchronizedLazySingleton {

    private static SynchronizedLazySingleton instance;

    private SynchronizedLazySingleton() {
    }

    public static synchronized SynchronizedLazySingleton getInstance() {
        if (null == instance) {
            instance = new SynchronizedLazySingleton();
        }
        return instance;
    }
}
